package com.nandi.emergencyinspection.mvp.macro

import com.nandi.emergencyinspection.api.ApiServices
import com.tbright.ktbaselibrary.extension.response
import kotlinx.coroutines.launch

/**
 * @创建者: qingsong
 * @创建时间: 2021/3/25 13:28
 * @描述:
 */
class MacrolookListPresenter : MacroLookListContract.MacroLookListPresenter() {


    override fun getList(
        page: Int,
        size: Int,
        disasterID: Int,
        startTime: String?,
        endTime: String?
    ) {
        mainScope.launch {
            mView?.showLoading()
            val singlePoetry = ApiServices.instance.getMacroInfoListAsync(
                current = page,
                size = size,
                disasterId = disasterID,
                createTime_begin = startTime,
                createTime_end = endTime
            ).response()

            mView?.showResult(singlePoetry)

            mView?.hideLoading()
        }
    }
}